<div class="page-content" >
	<div class="panel panel-default">
		<div class="panel-heading">
			<ul class="breadcrumb">
			
				<li><a   href="<{:U('log_template')}>">模板列表</a> </li>
				<li class="active">添加</li>
			</ul>
		</div>
		<div class="panel-body">
			<form id="myform" enctype="multipart/form-data"  method="post" class="form-horizontal" action="<{:U('add_log_template')}>">
				<input type="hidden" name="id" value="<{$data.id}>">
				 
				<div class="form-group">
					<label for="input-title"  class="col-sm-1 control-label">标题</label>
					<div class="col-sm-10">
						<input  type="text" class="form-control" id="title" name="title" value="<{$data.title}>">
					</div>
				</div>
				<div class="form-group">
					<label for="input-title"  class="col-sm-1 control-label">事件名称</label>
					<div class="col-sm-10">
						<input  type="text" class="form-control"  name="event" value="<{$data.event}>">
					</div>
				</div>
    	<div class="form-group">
					<label for="input-title"  class="col-sm-1 control-label">图标样式</label>
					<div class="col-sm-10">
						<input  type="text" class="form-control"  name="icon" value="<{$data.icon}>">
					</div>
				</div>
				
					<div class="form-group">
					<label for="input-title"  class="col-sm-1 control-label">数值</label>
					<div class="col-sm-10">
						<input  type="text" class="form-control"  name="num" value="<{:intval($data['num'])}>">
					</div>
				</div>
				<div class="form-group">
					<label for="input-title"  class="col-sm-1 control-label">显示</label>
					<div class="col-sm-10 mgt10">
						<{:form_radio("public",array('1'=>'公开','0'=>'私有'),$data['public'])}>
					</div>
				</div>
				 
				<div class="form-group">
					<label for="input-title"  class="col-sm-1 control-label">类型</label>
					<div class="col-sm-10">
						<select name="type" class="form-control">
						<option value="">请选择</option>
						<volist name="log_type" id="vo">
						<option <if condition="$data['type'] eq $key">selected="selected"</if> value="<{$key}>"><{$vo}></option>
						</volist>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label for="input-title"  class="col-sm-1 control-label">模板内容</label>
					<div class="col-sm-10">
						<textarea class="form-control" style=" height:120px"  name="content"><{$data.content}></textarea>
					</div>
				</div>
				 
				 
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="submit" class="btn btn-primary">保存</button>
						<if condition="$data['id']">
						<a href="<{:U('add_log_template')}>" class="btn btn-primary" >继续添加</a>
						</if>
						</div>
				</div>
			</form>
		</div>
	</div>
</div>
<script>
 
$(function(){
    $(".form-horizontal").bootstrapValidator({
        message: '您填入的值不合法',
        fields:{
            title: {
                message: '名称',
                validators: {
                    notEmpty: {
                        message: '名称为空'
                    },
                }
            },
			
			 event: {
                message: '事件名称',
                validators: {
                    notEmpty: {
                        message: '事件不能为空'
                    },
                }
            },
			type: {
                message: '类型',
                validators: {
                    notEmpty: {
                        message: '类型不能为空'
                    },
                }
            },
			
			 content: {
                message: '模板内容',
                validators: {
                    notEmpty: {
                        message: '模板内容不为空'
                    },
                }
            },
			
			 
			
        }
    });
	
 
});
 </script> 